Skip to content

test(node): Add integration tests for the Neon serverless driver - #25177

Merged
chargome merged 1 commit into
feat/neon-integrationfrom
test/neon-e2e
Oct 9, 2026
Merged

chargome merged 1 commit into
feat/neon-integrationfrom
test/neon-e2e

Conversation

@chargome

@chargome chargome commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Runs both Neon drivers end to end against Neon's own proxy (ghcr.io/timowilhelm/local-neon-http-proxy) in front of a local Postgres, so the HTTP /sql and WebSocket /v2 wire protocols are the real ones. Covers sql.query(), tagged templates, transaction() batches, a failing statement and pool queries, in ESM and CJS under the default span lifecycle.

The suite is excluded on Bun like the other database suites, since bun run cannot inject the diagnostics channels; the Bun plugin build does run it. The pool test is Node only, because on Bun and Deno the pool's connect callback runs outside the segment's async context. ws is added because Node 20 has no global WebSocket.

Stacked on #25164.

Refs #25144

@chargome
chargome changed the base branch from feat/neon-integration to feat/neon-orchestrion-config October 8, 2026 11:23
@chargome
chargome changed the base branch from feat/neon-orchestrion-config to feat/neon-integration October 8, 2026 11:23
@chargome
chargome added this pull request to stack #25178 October 8, 2026 11:23
@chargome chargome self-assigned this Oct 8, 2026
@chargome

chargome commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.8 kB - -
@sentry/browser - with treeshaking flags 27.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.84 kB - -
@sentry/browser (incl. Tracing) 51.85 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.87 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.8 kB - -
@sentry/browser (incl. Tracing, Replay) 91.58 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.29 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.27 kB - -
@sentry/browser (incl. Feedback) 47.32 kB - -
@sentry/browser (incl. sendFeedback) 34.84 kB - -
@sentry/browser (incl. FeedbackAsync) 39.95 kB - -
@sentry/browser (incl. Metrics) 30.82 kB - -
@sentry/browser (incl. Logs) 31.11 kB - -
@sentry/browser (incl. Metrics & Logs) 31.75 kB - -
@sentry/react 31.63 kB - -
@sentry/react (incl. Tracing) 54.17 kB - -
@sentry/vue 37.84 kB - -
@sentry/vue (incl. Tracing) 54.78 kB - -
@sentry/svelte 29.83 kB - -
@sentry/remix (Remix 3 client bundle) 56.83 kB - -
CDN Bundle 31.53 kB - -
CDN Bundle (incl. Tracing) 52.34 kB - -
CDN Bundle (incl. Logs, Metrics) 33.72 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.3 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.65 kB - -
CDN Bundle (incl. Tracing, Replay) 90.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.15 kB - -
CDN Bundle - uncompressed 92.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.46 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.46 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 161.41 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.5 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.63 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 281.57 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.26 kB - -
@sentry/nextjs (client) 56.53 kB - -
@sentry/sveltekit (client) 52.23 kB - -
@sentry/core/server 40.86 kB - -
@sentry/core/browser 13.71 kB - -
@sentry/node 151.64 kB +0.44% +652 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.77 kB +0.23% +185 B 🔺
@sentry/node - without tracing 94.2 kB +0.21% +197 B 🔺
@sentry/node - without channel injection 129.8 kB +0.51% +655 B 🔺
@sentry/aws-serverless 102.37 kB +0.2% +201 B 🔺
@sentry/cloudflare (withSentry) - minified 209.81 kB - -
@sentry/cloudflare (withSentry) 520.23 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 227.48 kB - -

View base workflow run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3b6fec1. Configure here.

@chargome
chargome marked this pull request as ready for review October 8, 2026 15:36
@chargome
chargome requested a review from a team as a code owner October 8, 2026 15:36
@chargome
chargome requested review from JPeer264, andreiborza and mydea and removed request for a team October 8, 2026 15:36

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I still have one question about the DB - maybe I misunderstand something


neonConfig.fetchEndpoint = 'http://localhost:4494/sql';

const sql = neon('postgres://test:test@db.localtest.me:5432/tests');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Is port 5432 exported? The docker file says 5496 is the host port 🤔 If it works I wonder if the tests is using the correct db

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test never connects to that address, the drivers only talk to the proxy on 4494 and the proxy connects to the compose database itself, so the host and port in the scenario only end up in the span attributes.

Comment thread dev-packages/node-integration-tests/suites/tracing/neon/test.ts Outdated
Run both Neon drivers against Neon's own proxy in front of a local
Postgres, so the HTTP and WebSocket wire protocols are the real ones.
Covers queries, tagged templates, batches, failing statements and pool
queries in ESM and CJS under the default span lifecycle.

ws is needed for the WebSocket driver on Node 20, which has no global
WebSocket.

Refs #25144
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chargome
chargome merged commit cb88771 into develop Oct 9, 2026
58 checks passed
@chargome
chargome deleted the test/neon-e2e branch October 9, 2026 10:41
chargome added a commit that referenced this pull request Oct 9, 2026
Adds `neonIntegration` for `@neondatabase/serverless`. Both drivers emit
`db` spans with the pg span shape: the WebSocket `Client`/`Pool` and the
HTTP `neon()` function, including Drizzle's `neon-http` and
`neon-serverless` adapters.

Subscribes to the channels from #25176 and registers the config, so
build-time bundler plugins get the same coverage as the runtime hook.

- The HTTP span wraps the executor inside `neon()`, not the lazy query
promise, so `transaction()` batches get one span instead of one per
statement plus one for the batch.
- Connection attributes for HTTP come from the connection resolver,
which runs inside the query span. The executor itself never sees the
connection string.
- `db.connection_string` is deprecated and not emitted.

End-to-end tests follow in #25177.

Stacked on #25176.

Fixes #25144

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants